package com.publiccms.entities.log;

// Generated 2016-5-16 17:06:12 by Hibernate Tools 4.3.1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sanluan.common.generator.annotation.GeneratorColumn;

/**
 * LogUpload generated by hbm2java
 */
@Entity
@Table(name = "log_upload")
public class LogUpload implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @GeneratorColumn(title = "ID")
    private Long id;
    @GeneratorColumn(title = "站点", condition = true)
    @JsonIgnore
    private int siteId;
    @GeneratorColumn(title = "用户", condition = true)
    private long userId;
    @GeneratorColumn(title = "渠道", condition = true)
    private String channel;
    @GeneratorColumn(title = "是否图片", condition = true)
    private boolean image;
    @GeneratorColumn(title = "站点", order = true)
    private long fileSize;
    @GeneratorColumn(title = "IP")
    private String ip;
    @GeneratorColumn(title = "操作日期", order = true)
    private Date createDate;
    @GeneratorColumn(title = "文件路径", condition = true, like = true)
    private String filePath;

    public LogUpload() {
    }

    public LogUpload(int siteId, long userId, String channel, boolean image, long fileSize, Date createDate, String filePath) {
        this.siteId = siteId;
        this.userId = userId;
        this.channel = channel;
        this.image = image;
        this.fileSize = fileSize;
        this.createDate = createDate;
        this.filePath = filePath;
    }

    public LogUpload(int siteId, long userId, String channel, boolean image, long fileSize, String ip, Date createDate,
            String filePath) {
        this.siteId = siteId;
        this.userId = userId;
        this.channel = channel;
        this.image = image;
        this.fileSize = fileSize;
        this.ip = ip;
        this.createDate = createDate;
        this.filePath = filePath;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "site_id", nullable = false)
    public int getSiteId() {
        return this.siteId;
    }

    public void setSiteId(int siteId) {
        this.siteId = siteId;
    }

    @Column(name = "user_id", nullable = false)
    public long getUserId() {
        return this.userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Column(name = "channel", nullable = false, length = 50)
    public String getChannel() {
        return this.channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    @Column(name = "image", nullable = false)
    public boolean isImage() {
        return this.image;
    }

    public void setImage(boolean image) {
        this.image = image;
    }

    @Column(name = "file_size", nullable = false)
    public long getFileSize() {
        return this.fileSize;
    }

    public void setFileSize(long fileSize) {
        this.fileSize = fileSize;
    }

    @Column(name = "ip", length = 64)
    public String getIp() {
        return this.ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_date", nullable = false, length = 19)
    public Date getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Column(name = "file_path", nullable = false, length = 500)
    public String getFilePath() {
        return this.filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

}
